import { defineStore } from 'pinia'
import type { UserInfo } from '@/types/user'

export const useUserStore = defineStore({
  id: 'user',
  state: () => ({
    token: '',
    userInfo: null as UserInfo | null
  }),
  actions: {
    setToken (token: string) {
      this.token = token
    },
    setUserInfo (userInfo: UserInfo | null) {
      this.userInfo = userInfo
    }
  }
})
